package com.yunxi.yunxicaiproject.Controller;

import com.yunxi.yunxicaiproject.entity.vo.ActivityParticipationVO;
import com.yunxi.yunxicaiproject.entity.vo.LeaveApplicationVO;
import com.yunxi.yunxicaiproject.entity.vo.ScheduleVO;
import com.yunxi.yunxicaiproject.tool.StudentTools;
import com.yunxi.yunxicaiproject.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/ai")
public class LeaveController {
    @Autowired
    StudentTools studentTools;

    @GetMapping("/leave")
    public R list(String studentId){
        if (studentId==null){
            return R.error("学生学号为空！");
        }
        List<LeaveApplicationVO> vos = studentTools.getLeaveInfo(studentId);
        return R.ok().put("data", vos);
    }

}
